﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dapper.Moon
{
    public class UnitOfWorkManager
    {
        private UnitOfWorkManager() { }

        public static IUnitOfWork Begin(IDapperMoon context, IsolationLevel isolationLevel = IsolationLevel.ReadCommitted)
        {
            IUnitOfWork unitOfWork = new UnitOfWork(context);
            unitOfWork.IsolationLevel = isolationLevel;
            unitOfWork.Begin();
            return unitOfWork;
        }
    }
}
